home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / os2 / srefv12i.zip / srefquik.doc < prev    next >
Text File  |  1997-03-04  |  8KB  |  184 lines

  1. 23 Feb 1997.    The SREFQUIK variant of SRE-Filter.
  2.  
  3. 1) Introduction
  4.  
  5. SRE-Filter is a full-featured web server. That's nice, but what if
  6. you don't need always need all these features?  Is there some
  7. way to trade-off some of the feature richness in exchange for
  8. increased performance?
  9.  
  10. The answer is a qualified yes:
  11.   in many cases, if you are willing to do a little bit of extra work,
  12.   you can use the SREFQUIK variant of SRE-Filter.
  13.  
  14. The main advantage of SREFQUIK is that it is small.
  15.   "Small" is especially advantageous under moderate to heavy load --
  16.   many threads running a "small"  filter will place less strain
  17.   on system resources then the same number of threads running
  18.   the larger "standard" filter.  And since moderate load (say,
  19.   greater then 10 requests simultaneously) is pretty easy
  20.   to achieve (just by serving an inline-image rich document
  21.   to one client), the actual performance impacts can be significant
  22.   even on less-than-busy sites.
  23.  
  24. So why isn't SRE-Filter running SREFQUIK by default? As they say,
  25. the devil is in the details.
  26.  
  27.  
  28. 2) Is SREFQUIK right for me?
  29.  
  30. If ...
  31.   you are serving only 1 host, and
  32.   you have many selectors that you can specify with "literal" PUBLIC_URLS
  33.   or GoServe is caching many requests
  34.  
  35. then ...
  36.  
  37.    you can greatly improve throughput by using
  38.    the SREFQUIK.80 filter instead of  SREFILTR.80.
  39.  
  40. SREFQUIK specializes in processing "literal PUBLIC_URLS" on a single
  41. host server.  Let's review "literal PUBLIC_URLS":
  42.  
  43.   A "literal PUBLIC_URLS" is a PUBLIC_URL defined with the
  44.   LITERAL or LITERAL_NORECORD option.
  45.  
  46.   For these PUBLIC_URLS, SRE-Filter will not attempt aliasing,
  47.   virtual directory lookup, access control,or auto_header creation.
  48.   Furthermore, server side includes will NOT be attempted.
  49.  
  50.   In other words, SRE-Filter will just find the file that the request
  51.   selector maps to, and transfer it (see INITFILT.DOC for the details).
  52.  
  53. Since "literal" PUBLIC_URLS (actually, selectors that match a PUBLIC_URL
  54. with a LITERAL or LITERAL_NORECORD option) are subject to very little
  55. processing, it makes sense to use a "small" filter that doesn't
  56. bother to try.
  57.  
  58. That's a good idea, but it's not likely that all you want to do
  59. is serve literal PUBLIC_URLS (if that were the case, you'ld probably
  60. be better off with the generic GoServe filter). Recognizing this
  61. possibility ....
  62.      if the selector does not match a "literal public_url",
  63.      the standard filter is called, with no loss of capability.
  64.  
  65. Sounds good so far -- but there's more. In addition to "literal
  66. public_urls" (for which little work needs to be done), SREFQUIK will
  67. also handle "cached" responses). "Cached" responses occur when
  68. GoServe was able to resolve the request with a file in it's cache.
  69.    (assuming that GoServe's cache has been enabled -- and if you haven't
  70.    enabled GoServe's cache, then you are missing out on the best
  71.    performance modification you can make).
  72. In such cases, SRE-Filter has almost nothing to do, except record the request:
  73. a chore well suited to a small filter (especially since "recording" is
  74. accomplished simply by transfering information to the "post-filter thread").
  75.  
  76. :<   Alas, there are drawbacks  :<
  77.  
  78.  * Since SREFQUIK adds overhead to requests that are NOT to
  79.    "literal public_urls", if you specify few "literal public_urls" the
  80.    net effect may be detrimental. Thus:
  81.        When using SREFQUIK, it is advantageous to specify as many
  82.        "literal public_urls" as possible.
  83.  
  84.  * If you have specified multiple hosts, SREFQUIK should NOT be used.
  85.  
  86.  * If you use SREFQUIK, "cached" responses will not be checked for
  87.    the NO_POSTFILTER access permission. That is, SREFQUIK will
  88.    "post-filter" all cached response (that don't match a PUBLIC_URL)
  89.  
  90.    Although we could directly resolve this problem (by looking up
  91.    the access permissions), for performance reasons we don't want to
  92.    try.  However, SREFQUIK does offer a work around to this problem
  93.    (described in the next section).
  94.  
  95. What are we to conclude?  If you are willing to specify "literal"
  96. PUBLIC_URLS,  or if you have a lot of files that will be cached,
  97. then it's a good idea to use SREFQUIK.
  98.  
  99.     In particular, if your documents contain many in-line
  100.     images, most of which you really don't need to keep track of,
  101.     then the use of SREFQUIK can yield significant advantages.
  102.  
  103. And if you are willing to do a little bit of extra work, you can deal
  104. with the third drawback (as well as further improve performance).
  105.  
  106. On that note, let's consider the SREFQUIK parameters.
  107.  
  108.  
  109.  
  110. 3) SREFQUIK parameters.
  111.  
  112. SREFQUIK.80 contains a few user-configurable parameters.  These parameters
  113. effect how SREFQUIK.80 deals with "post-filter" activities, including
  114. writing to the common-log audit file and augmenting the RECORD_ALL_FILE.
  115. If you aren't using either mechanism (and if you don't have a custom
  116. post-filter enabled), then you can ignore this section.  Actually, if you
  117. are running such a site (if you are not doing ANY post-filter actions), 
  118. you might as well disable the "call filter anyway" GoServe caching option.
  119.  
  120. There are two (sets) of parameters: the NO_RECORDS. "stem" variables,
  121. and the NO_RECORDS_ONLY variable.
  122.  
  123. NO_RECORDS.1, ..., NO_RECORDS.n and NO_RECORDS.0
  124.    A stem variable containing selectors that should NOT be subject
  125.    to post-filter processing.
  126.  
  127.    Each of these values should contain a candidate selector string.
  128.  
  129.    For example:
  130.       no_records.1='IMGS/'
  131.       no_records.2='SAMPLES/SREFILTR.HTM
  132.       no_records.3='HELP/PUB'
  133.       no_records.0=3
  134.  
  135.       *  To speed up processing, abbreviation matching is done.  That is,
  136.          wildcards are NOT recognized.
  137.          For example:  IMGS/A.GIF would match no_records.1
  138.                        IMGS2/A.GIF would NOT
  139.                        HELP/PUBLIC/FOO.HTM would match no_records.3
  140.                        HELP/PU/FOO.HTM would NOT
  141.        * Reiterating: do NOT use * in the NO_RECORDS. stem variables
  142.          Hint: See the discussion of the NOURL option, in  SREFLOGS.DOC,
  143.                for a method of suppressing explicit entries to the
  144.                common-log file.
  145.        * You MUST include a NO_RECORDS.0=n variable, where n is the
  146.          number of NO_RECORDS variables you've specified.
  147.        * Case is ignored, \ are converted to /, and a leading / is stripped.
  148.  
  149.     If a request selector matches one of the no_records. variables,
  150.     then post-filter processing (auditing, etc.) will NOT occur.
  151.  
  152. The use of no_records. variables allows you to compensate for
  153. "drawback 3" -- the non-checking for a NO_POSTFILTER permission when dealing
  154. with cached requests.  In addition, it can help improve peformance:
  155.  
  156.    SREFQUIK will check the PUBLIC_URLS for a matching "NORECORD"
  157.    entry.  If one is found, then post-filter processing will not occur.
  158.    The process of checking is a bit time consuming, especially compared
  159.    to scanning the NO_RECORDS variables.  Furthermore, if you are
  160.    a thorough and include a NO_RECORDS. entry that's equivalent
  161.    to all of your NORECORD (and LITERAL_NORECORD) PUBLIC_URLS, then
  162.    there is no reason to examine the PUBLIC_URLS.
  163.  
  164. Since being thorough is often easy, you can suppress "checking the
  165. PUBLIC_URLS after a cached request" by enabling the NO_RECORDS_ONLY parameter.
  166.  
  167. NO_RECORDS_ONLY
  168.    To further speed up processing, you can suppress examination of
  169.    the PUBLIC_URLS after a cached request.
  170.    If NO_RECORDS_ONLY=1, then just the NO_RECORDS. variables are checked.
  171.  
  172.  
  173. Summarizing: if you are willing to edit SREFQUIK.80 and create a
  174. complete set of NO_RECORDS. variables, then you can (slightly) improve
  175. performance, and simultaneosly deal with one of the SREFQUIK drawbacks.
  176.  
  177. ... and if you don't want to bother, SREFQUIK can still provide a significant
  178. performance advantage.
  179.  
  180.  
  181. Btw: You can change these SREFQUIK parameters "on the fly" -- you don't have
  182.      to restart GoServe after changing them (in contrast, changes to 
  183.      SREFILTR.80 parameters necessitate shutting down and restarting GoServe).
  184.